<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/12/7
 * Time: 10:24
 */

namespace api\storage\model;


use think\Model;

class SupplierMaterielModel extends Model
{
    protected $table = 'iwh_supplier_materiel';
    protected $pk = 'uuid';

    public function findByIdAndMaterielId($supplierId,$materielId){
        return $this->where('supplier_id',$supplierId)
            ->where('sub_materiel_id',$materielId)
            ->find();
    }
    public function add($data){
        return $this->save($data);
    }

    public function updateCount($uuid,$data){
        return $this->isUpdate(true)->save($data,['uuid'=>$uuid]);
    }


}